﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Lg.Core.DbHelper
{
    public interface IDBHelper
    {
         string _readCnnStr { get; set; }
         string _writeCnnStr { get; set;}

        #region[sql 原生方法]
        /// <summary>
        /// 增，删 ，改
        /// </summary>
        /// <param name="sql">sql语句</param>
        /// <returns></returns>
        int ExecuteNonQuery(string sql);
        /// <summary>
        /// 有参数的 增，删 ，改
        /// </summary>
        /// <param name="sql">sql语句</param>
        /// <param name="listParam">参数</param>
        /// <returns></returns>
        int ExecuteNonQuery(string sql, List<DBParameter>? listParam = null);
        /// <summary>
        /// 返回1行一列，无数据则为null,最大长度为2033个字符
        /// </summary>
        /// <param name="sql"></param>
        /// <param name="listParam"></param>
        /// <returns></returns>
        object ExecuteScalar(string sql, List<DBParameter>? listParam = null);


        DataSet Query(string sql, List<DBParameter>? listParam = null);

        #endregion

    }
}
